<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>添加管理员</title>
    <link href="../css/bootstrap-cerulean.css" rel="stylesheet">
    <link href="../css/charisma-app.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }
    </style>
    <script src="http://lib.sinaapp.com/js/jquery/2.2.4/jquery-2.2.4.min.js"></script>
    <script src="../js/common/public.js"></script>
    <script src="../js/base64.js"></script>
    <script src="../js/bootstrap-modal.js"></script>
    <script type="text/javascript">
       function addAdmin() {
            var urlMsg = parseUrl(window.location.search);
            var userName = $("#userName").val();
            var password = $("#password").val();
            var status = $("#status").val();
            if (urlMsg.token != null) {
                var token = decode(urlMsg.token);
                token = token.substring(0, token.length - 1);
            }
            var year = $.ajax({
                type: "POST",
                url: "http://localhost:1068/admin/addAdmin",
                data:{token:token,userName:userName,password:password,status:status},
                async: false
            }).responseText;
            var yearReuslt = eval('(' + year + ')');
            if (yearReuslt.code != 200) {
                alert(yearReuslt.msg)
            } else {
                alert("添加成功！")
                javascript:history.go(-1);
            }
        }
    </script>
</head>

<body>
<div class="container-fluid"
     style="padding-left:0px;padding-right:2px;">
    <div class="row-fluid">
        <div id="content" class="span10" style="width:100%;">
            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header well">
                        <h2>
                            <i class="icon-edit"></i>添加管理员信息
                        </h2>
                    </div>
                    <div class="box-content" style="text-align:center; padding-top:50px">
                        <form action="admin/add_admindeal.action" method="post">
                            <fieldset>
                                <h1>添加管理员信息</h1>
                                <br>
                                <br>
                                <div class="control-group">
                                    <div class="controls">
                                        <span style="font-size:14px">用户名称：</span><input name="username" class="input"
                                                                                        id="userName" type="text"
                                                                                        style="height:30px;">
                                    </div>
                                </div>
                                <br>

                                <div class="control-group">
                                    <div class="controls">
                                        <span style="font-size:14px">用户密码：</span><input name="password" class="input"
                                                                                        id="password" type="text"
                                                                                        style="height:30px;">
                                    </div>
                                </div>
                                <br>

                                <div class="control-group">
                                    <div class="controls">
                                        <span style="font-size:14px">用户状态：</span>
                                        <select name="status" id="status" style="width:210px;">
                                            <option selected="selected" value="1">启用</option>
                                            <option value="0">锁定</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-actions">
                                    <button type="button" onclick="addAdmin()" class="btn btn-primary" style="width:100px;">提交</button>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <button class="btn" onclick="javascript:history.go(-1);" type="reset"
                                            style="width:100px;">取消
                                    </button>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>